import { ElLoading } from "element-plus";

let loading: any;

/**
 * 启动全局加载
 */
export const start_loading = (msg?: string) => {
    loading = ElLoading.service({
        lock: true,
        text: msg || '请稍后...',
        background: 'rgba(0, 0, 0, 0.7)',
    })
}

/**
 * 关闭全局加载
 */
export const close_loading = () => {
    if (loading)
        loading.close();
}
